﻿namespace YiHaoHospitalPlatform.Model
{
    public class Patient:BaseModel
    {
        /// <summary>
        /// 住院号，单次住院的流水号
        /// </summary>
        public string ZYH { get; set; }
        /// <summary>
        /// 病案号，病人在医院的唯一号码
        /// </summary>
        public string ZYHM { get; set; }
        /// <summary>
        /// 腕带号
        /// </summary>
        public string WDHM { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        public string XM { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public string XB { get; set; }
        /// <summary>
        /// 当前病区
        /// </summary>
        public string DQBQ { get; set; }
        /// <summary>
        /// 当前床位
        /// </summary>
        public string DQCW { get; set; }

        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return false;
            }
            if ((obj.GetType().Equals(this.GetType())) == false)
            {
                return false;
            }
            Patient temp = null;
            temp = (Patient)obj;

            return this.DQBQ.Equals(temp.DQBQ) && this.DQCW.Equals(temp.DQCW) && this.WDHM.Equals(temp.WDHM)
                && this.XB.Equals(temp.XB) && this.XM.Equals(temp.XM) && this.ZYH.Equals(temp.ZYH) && this.ZYHM.Equals(temp.ZYHM);
        }

        //重写GetHashCode方法（重写Equals方法必须重写GetHashCode方法，否则发生警告
        public override int GetHashCode()
        {
            return this.DQBQ.GetHashCode() + this.DQCW.GetHashCode() + this.WDHM.GetHashCode() + this.XB.GetHashCode() + this.XM.GetHashCode() + this.ZYH.GetHashCode() + this.ZYHM.GetHashCode();
        }
    }
}
